/**
 * Created by Generator on 2017/08/03
 */
package com.nmgmd.shequ.hospital.base.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import com.nmghr.base.jpa.annotation.ColumnComment;
import com.nmghr.base.jpa.entity.UUIDWithTimeEntity;
import com.nmghr.manager.rbac.entity.DictionaryEntity;
import javax.persistence.*;
import java.math.BigDecimal;

@Entity
@Table(name = "t_hos_medicine")
@Data
@EqualsAndHashCode(callSuper = true)
public class MedicineEntity extends UUIDWithTimeEntity {
    @Column(name="bar_code", length=400)
    @ColumnComment(msg = "条形码")
    private String barCode;

    @Column(name="qr_code", length=300)
    @ColumnComment(msg = "二维码")
    private String qrCode;

    @Column(name="serial_number", length=100)
    @ColumnComment(msg = "货号")
    private String serialNumber;

    @ColumnComment(msg = "药品类型")
    @ManyToOne
    @JoinColumn(name = "type_id")
    private DictionaryEntity type;

    @Column(name="directives", length=100)
    @ColumnComment(msg = "批文")
    private String directives;

    @Column(name="batch", length=100)
    @ColumnComment(msg = "批号")
    private String batch;

    @Column(name="specifications", length=100)
    @ColumnComment(msg = "规格")
    private String specifications;

    @Column(name="bid", precision=18, scale=2)
    @ColumnComment(msg = "进价")
    private BigDecimal bid;

    @Column(name="retail_price", precision=18, scale=2)
    @ColumnComment(msg = "零售价")
    private BigDecimal retailPrice;

    @Column(name="vip_price", precision=18, scale=2)
    @ColumnComment(msg = "会员价")
    private BigDecimal vipPrice;

    @Column(name="medicine_name", length=100)
    @ColumnComment(msg = "药品名称")
    private String medicineName;

    @Column(name="medicine_name_py", length=100)
    @ColumnComment(msg = "药品名称拼音")
    private String medicineNamePy;

    @ColumnComment(msg = "厂家")
    @ManyToOne
    @JoinColumn(name = "factory_id")
    private FactoryEntity factory;

}
